home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / CommResources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  3.0 KB  |  106 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        CommResources.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __COMMRESOURCES__
  13. #define __COMMRESOURCES__
  14.  
  15. #ifndef __OSUTILS__
  16. #include <OSUtils.h>
  17. #endif
  18.  
  19.  
  20. enum {
  21.  
  22.  
  23. /*    version of the Comm Resource Manager    */
  24.  curCRMVersion = 2,
  25.  
  26. /*    tool classes (also the tool file types)    */
  27.  
  28. #define classCM 'cbnd'
  29. #define classFT 'fbnd'
  30. #define classTM 'tbnd'
  31.  
  32. /* constants general to the use of the Communications Resource Manager */
  33.  
  34.  crmType = 9,            /* queue type    */
  35.  crmRecVersion = 1,        /* version of queue structure */
  36.  
  37. /*    error codes */
  38.  crmGenericError = -1,
  39.  crmNoErr = 0
  40. };
  41.  
  42. /* data structures general to the use of the Communications Resource Manager */
  43. typedef OSErr CRMErr;
  44.  
  45. struct CRMRec {
  46.  QElemPtr qLink;        /*reserved*/
  47.  short qType;            /*queue type -- ORD(crmType) = 9*/
  48.  short crmVersion;        /*version of queue element data structure*/
  49.  long crmPrivate;        /*reserved*/
  50.  short crmReserved;        /*reserved*/
  51.  long crmDeviceType;    /*type of device, assigned by DTS*/
  52.  long crmDeviceID;        /*device ID; assigned when CRMInstall is called*/
  53.  long crmAttributes;    /*pointer to attribute block*/
  54.  long crmStatus;        /*status variable - device specific*/
  55.  long crmRefCon;        /*for device private use*/
  56. };
  57.  
  58. typedef struct CRMRec CRMRec;
  59. typedef CRMRec *CRMRecPtr;
  60.  
  61.  
  62. #ifdef __cplusplus
  63. extern "C" {
  64. #endif
  65. pascal CRMErr InitCRM(void); 
  66. pascal QHdrPtr CRMGetHeader(void); 
  67. pascal void CRMInstall(QElemPtr crmReqPtr); 
  68. pascal OSErr CRMRemove(QElemPtr crmReqPtr); 
  69. pascal QElemPtr CRMSearch(QElemPtr crmReqPtr); 
  70. pascal short CRMGetCRMVersion(void); 
  71.  
  72. pascal Handle CRMGetResource(ResType theType,short theID); 
  73. pascal Handle CRMGet1Resource(ResType theType,short theID); 
  74. pascal Handle CRMGetIndResource(ResType theType,short index); 
  75. pascal Handle CRMGet1IndResource(ResType theType,short index); 
  76. pascal Handle CRMGetNamedResource(ResType theType,ConstStr255Param name); 
  77. pascal Handle CRMGet1NamedResource(ResType theType,ConstStr255Param name); 
  78. pascal void CRMReleaseResource(Handle theHandle); 
  79. pascal Handle CRMGetToolResource(short procID,ResType theType,short theID); 
  80. pascal Handle CRMGetToolNamedResource(short procID,ResType theType,ConstStr255Param name); 
  81. pascal void CRMReleaseToolResource(short procID,Handle theHandle); 
  82. pascal long CRMGetIndex(Handle theHandle); 
  83.  
  84. pascal short CRMLocalToRealID(ResType bundleType,short toolID,ResType theType,
  85.  short localID); 
  86. pascal short CRMRealToLocalID(ResType bundleType,short toolID,ResType theType,
  87.  short realID); 
  88.  
  89. pascal OSErr CRMGetIndToolName(OSType bundleType,short index,Str255 toolName); 
  90.  
  91. pascal OSErr CRMFindCommunications(short *vRefNum,long *dirID); 
  92.  
  93. pascal Boolean CRMIsDriverOpen(ConstStr255Param driverName); 
  94.  
  95. pascal CRMErr CRMParseCAPSResource(Handle theHandle,ResType selector,unsigned long *value); 
  96.  
  97. pascal OSErr CRMReserveRF(short refNum); 
  98. /*  decrements useCount by one  */
  99. pascal OSErr CRMReleaseRF(short refNum); 
  100.  
  101. #ifdef __cplusplus
  102. }
  103. #endif
  104.  
  105. #endif
  106.